<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'addcontact.jsp' starting page</title>
  </head>
  
  <body>
  	<h2 align="center">添加联系人</h2>
    <form action="${pageContext.request.contextPath }/servlet/AddContactServlet" method="post" >
    <table align="center" >
    	<tr>
    		<td>姓名：</td>
    		<td><input type="text" name="contactname"/></td>
    	</tr>
    	
    	<tr>
    		<td>电话：</td>
    		<td><input type="text" name="phone"/></td>
    	</tr>
    	
    	<tr>
    		<td>电子邮件：</td>
    		<td><input type="text" name="email"/></td>
    	</tr>
    	
    	<tr>
    		<td>QQ:</td>
    		<td><input type="text" name="qq"/></td>
    	</tr>
    	
    	<tr>
    		<td>所在分组：</td>
    		<td>
    			<select name="groupid">
    				<c:forEach var="c" items="${list }">
    					<option value="${c.groupid }" ${c.groupid==rg?"selected='selected'":'' }>${c.groupname }</option>
    				</c:forEach>
    			</select>
    		</td>
    	</tr>
    	
    	<tr>
    		<td>
    			<input type="reset" name="reset" value="重置"/>
    		</td>
    		<td>
    			<input type="submit" name="submit" value="添加"/>
    		</td>
    	</tr>
    </table>
    </form>
    
  </body>
</html>
